Scenario #5001: Subscribe Existing Person and Contact to Mailinglist

UseCase Subscribe Existing Person And Contact To Mailinglist => Subscription: Michael Miller to operations-discussion

Properties

Required

Given

name value
partnerPersonTradeName Test AG
subscriberFamilyName Miller
subscriberGivenName Michael
subscriberEMailAddress michael.miller@example.org
mailingList operations-discussion

Person: Test AG

HTTP GET "/api/hs/office/persons?name=Test+AG" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "1223603d-1a3b-4e0c-a244-027585d22eb2", // Person: Test AG
  "personType" : "LEGAL_PERSON",
  "tradeName" : "Test AG",
  "salutation" : null,
  "title" : null,
  "givenName" : null,
  "familyName" : null
} ]

In production, data this query could result in multiple outputs. In that case, you have to find out which is the right one.

Person: Michael Miller

HTTP GET "/api/hs/office/persons?name=Miller" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "ca28a2f0-a2c0-4db8-bf2e-7f07bf7d235e",
  "personType" : "NATURAL_PERSON",
  "tradeName" : null,
  "salutation" : null,
  "title" : null,
  "givenName" : "Michael",
  "familyName" : "Miller"
} ]

In real scenarios there are most likely multiple results and you have to choose the right one.

Contact: michael.miller@example.org

HTTP GET "/api/hs/office/contacts?emailAddress=michael.miller@example.org" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }`
=> status: 200 OK 
[ {
  "uuid" : "6f4f7197-a1b6-4d06-8d89-f823d308cb24",
  "caption" : "Michael Miller",
  "postalAddress" : { },
  "emailAddresses" : {
    "main" : "michael.miller@example.org"
  },
  "phoneNumbers" : { }
} ]

In real scenarios there are most likely multiple results and you have to choose the right one.

Create Subscription: Michael Miller to operations-discussion

HTTP POST "/api/hs/office/relations" \
  -H "Authorization: Bearer $HSADMINNG_JWT_BEARER" \
  `# {` \
  `#   "sub" : "uuid<hsh-alex_superuser>"` \
  `# }` \
  -H 'Content-Type: application/json' \
  --data-binary @- <<EOF
{
  "type" : "SUBSCRIBER",
  "mark" : "operations-discussion",
  "anchor.uuid" : "1223603d-1a3b-4e0c-a244-027585d22eb2", // Person: Test AG
  "holder.uuid" : "ca28a2f0-a2c0-4db8-bf2e-7f07bf7d235e", // Person: Michael Miller
  "contact.uuid" : "6f4f7197-a1b6-4d06-8d89-f823d308cb24" // Contact: michael.miller@example.org
}
EOF
=> status: 201 CREATED 635411c5-473a-43af-90fc-bc57b4cbe7a9

generated on 2026-07-17 01:44:27 for branch